The present invention is related generally to delivery of web pages to multiple device types and, more particularly, to the delivery of web pages that are optimized for the display medium.
Prior art methods for delivering web pages to an electronic computing device, such as personal computers, workstations, or handheld devices, relied upon scripted logic that dynamically modified the markup instructions delivered to the browser through detection of the Hypertext Transfer Protocol (HTTP) or browser environment variables. In one scenario, device type detection takes place on the server when a page request is received. Depending on which device type is detected, the requested page is processed to include Hypertext Markup Language (HTML) code that is uniquely suited to the requirements of the requesting device. A disadvantage of this prior art method is that it places additional processing burden on the application server executing the detection, compromising the performance of the server. In another prior art method, device detection takes place through the use of a client-side scripting language. In this method, a script is passed to the browser along with the requested HTML code. The processed script parses the HTTP environment variables and modifies the HTML instructions the browser uses to render the page. A disadvantage of this method is that it requires a device that is capable of processing client-side script. A device that does not have client side scripting capability, or if such scripting capability has been disabled by the device owner, will not process the HTML code appropriately and will not render the intended presentation.
Most web sites that are created are written for, and tested on, desktop computers with large color monitors. Typically, web sites are designed with fixed widths (e.g., 468 pixel wide center column) that make them difficult to view and navigate on small screen devices. To read an article on a small screen device, the user would have to scroll back and forth horizontally for each line of text. Small screen browsers reformat the page to fit inside the screen width and eliminate horizontal scrolling. Only the layout of the page changes; the content and functionality remains the same.
The same HTML web page can be presented for different media by using Cascading Style Sheets (CSS). The present invention is intended to address the need to deliver media-optimized Cascading Style Sheets. An important feature of style sheets is that they specify how a document is to be presented on different media. Style sheets for different media types may share a property, but require different values for that property. For handheld style sheets, the CSS properties max-width and max-height are very useful, the screen width of most PDAs typically being 240 pixels. There are two ways to specify media dependencies for style sheets. The first is to specify the target medium from a style sheet with the @media or @import attributes. The second is to specify the target medium within the document language.
The @media rule specifies the target media types of a set of rules. The @media construct allows style sheet rules for various media in the same style sheet. A CSS media type names a set of CSS properties. Recognized media types include “all,” “handheld,” “print,” and “screen” among others. The “all” media type means suitable for all devices. The “handheld” media type is intended for handheld devices having small monochrome screens and limited bandwidth. The “print” media type is intended for documents viewed on screen in print preview mode. “Screen” is intended for color computer screens. Each CSS property definition specifies the media types for which the property must be implemented by a conforming user agent. Each property applies to all media types in the media groups listed in its definition.
The @import rule allows users to import style rules from other style sheets. The @import rules must precede all rule sets in a style sheet. The @import keyword must be followed by the Uniform Resource Locator (URL) of the style sheet to include. Imported style sheets also cascade and their weight depends on their import order. Rules that are specified in a given style sheet override rules imported from other style sheets.